<%# used by multiple views %>
<%= form_tag '?', method: :get do %>
  <div class="col-md-5 clearfix">&nbsp;</div>

  <div class="col-md-3 clearfix">
    <%= text_field_tag :search, params[:search], class: 'form-control', placeholder: 'Search' %>
  </div>

  <div class="col-md-1 clearfix">
    <%= select_tag :integration, options_for_select([['', nil], ['Integration', 'true'], ['Regular', 'false']], params[:integration]), class: 'form-control' %>
  </div>

  <div class="col-md-2 clearfix">
    <% roles = [['', '']] + (system_level ? Role.all[1..-1] : UserProjectRole::ROLES).map { |r| [r.name.capitalize, r.id] } %>
    <%= select_tag :role_id, options_for_select(roles, params[:role_id]), class: 'form-control' %>
  </div>

  <% unless system_level %>
    <% if @project %>
      <%= hidden_field_tag :project_id, @project.id %>
    <% else %>
      <%= hidden_field_tag :user_id, @user.id %>
    <% end %>
  <% end %>

  <div class="col-md-1 clearfix">
    <%= submit_tag "Search", class: "btn btn-default form-control" %>
  </div>
<% end %>
